<template>
   <div class="invitation">
     <div class="invitation-qrCode">
       <img :src="shareImg" @click="previewImage">
     </div>
  </div>
</template>

<script>

export default {
  data(){
    return{
      activityId: '',
      shareImg: '',
      shareImgList: []
    }
  },
  onLoad(option){
    var userToken = wx.getStorageSync('userToken');
    this.shareImg = 'https://study.rzkeji.com/api/activity/generateShareQrCode?user_token=' + userToken + '&activity_id=' + option.id;
    let arr = [];
    arr.push(this.shareImg);
    this.shareImgList = arr;
  },
  methods:{
    previewImage(e){  
      var current=e.target.dataset.src;
      wx.previewImage({
          current: current, // 当前显示图片的http链接
          urls: this.shareImgList // 需要预览的图片http链接列表
      })
	  }  
  }
}
</script>

<style lang="stylus" scoped>
  .invitation
    width 100%
    height 100vh
    background-color #000
    display flex
    justify-content center
    align-items center
    .invitation-qrCode
      width 100%
      height 84vh
      background-color #fff
      padding 0 20rpx
      border-radius 6rpx
      img
        width 100%
        height 80vh
</style>